package com.sino.operation.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sino.operation.entity.BizTaskRelease;
import com.sino.operation.mapper.BizTaskReleaseMapper;
import com.sino.operation.service.BizTaskReleaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: BizTaskReleaseServiceImp
 * @Description:
 * @Author dengls
 * @date 2021/10/15 18:01
 */
@Service
public class BizTaskReleaseServiceImpl extends ServiceImpl<BizTaskReleaseMapper, BizTaskRelease> implements BizTaskReleaseService {

    @Autowired(required = false)
    private BizTaskReleaseMapper taskReleaseMapper;

    @Override
    public void releaseTask(String journalNo) {
        QueryWrapper<BizTaskRelease> queryWrapper = new QueryWrapper<>();
        if (journalNo != null && !journalNo.isEmpty()) {
            queryWrapper.eq("JOURNAL_NO", journalNo);
        }
        taskReleaseMapper.delete(queryWrapper);
    }
}
